﻿
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Reflection;
using Furion.RemoteRequest;
using IoTClient;
using Microsoft.AspNetCore.Components;

namespace IotClientWeb.Interface;
public interface IHttp : IHttpDispatchProxy
{

    [Post, Client("ResultDataApi")]  
    Task<HttpResponseMessage> PostResultDataAsync([Body("application/json", "UTF-8")] string equipData);

    [Post, Client("ProcessDataApi")]
    Task<HttpResponseMessage> PostProcessDataAsync([Body("application/json", "UTF-8")] string equipData);
    [Post, Client("EquipStatusApi")]
    Task<HttpResponseMessage> PostEquipStatusApiAsync([Body("application/json", "UTF-8")] string equipData);
    [Post, Client("AlarmApi")]
    Task<HttpResponseMessage> PostAlarmAsync([Body("application/json", "UTF-8")] string equipData);
    [Post, Client("EnergyApi")]
    Task<HttpResponseMessage> PostEnergyAsync([Body("application/json", "UTF-8")] string equipData);

    // 全局拦截，类中每一个方法都会触发
    [Interceptor(InterceptorTypes.Request)]
    static void OnRequest1(HttpClient client, HttpRequestMessage req)
    {
        Console.WriteLine("before request");
    }
    // 全局拦截，类中每一个方法都会触发
    [Interceptor(InterceptorTypes.Response)]
    static void OnResponsing1(HttpClient client, HttpResponseMessage res)
    {

    }

}